//
//  BigImageCollectionViewCell.m
//  BeautyClother
//
//  Created by dllo on 15/8/31.
//  Copyright (c) 2015年 宋爽. All rights reserved.
//

#import "BigImageCollectionViewCell.h"

@interface BigImageCollectionViewCell ()
@property (nonatomic, assign) CGFloat offWidth;
@property (nonatomic, assign) CGFloat offHeight;

@end

@implementation BigImageCollectionViewCell

- (void)dealloc
{
    [super dealloc];
}

- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        
        self.offWidth = [[UIScreen mainScreen]bounds].size.width / 375;
        self.offHeight = [[UIScreen mainScreen]bounds].size.height / 667;
        self.image = [[UIImageView alloc]init];
        [self.contentView addSubview:_image];
       
        [_image release];
        self.brand = [[UILabel alloc]init];
        [self.contentView addSubview:_brand];
        _brand.backgroundColor = [UIColor whiteColor];
        _brand.textColor = [UIColor lightGrayColor];
        _brand.textAlignment = 1;
        self.contentView.backgroundColor = [UIColor clearColor];
        self.layer.cornerRadius = 5;
        self.layer.masksToBounds = YES;
        
        self.like = [[UIButton alloc]init];
        [self.image addSubview:self.like];
        [self.like release];

    }
    return self;
}

- (void)layoutSubviews
{
    [super layoutSubviews];
    _image.frame = CGRectMake(20 * _offWidth, 0, self.frame.size.width - 40 * _offWidth, self.frame.size.height - 100 * _offHeight);

    
    _brand.frame = CGRectMake(20 * _offWidth, _image.frame.size.height, self.frame.size.width - 40 *_offWidth, 100 * _offHeight);
    
    _like.frame = CGRectMake(_image.frame.size.width - 70 * _offWidth, 5, 70 * _offWidth, 50 * _offHeight);

}

@end
